package com.nbsaas.boot.room.rest.convert;

import com.nbsaas.boot.room.data.entity.RoomPrice;
import com.nbsaas.boot.room.api.domain.simple.RoomPriceSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 列表对象转换器
*/

public class RoomPriceSimpleConvert implements Converter<RoomPriceSimple, RoomPrice> {




@Override
public RoomPriceSimple convert(RoomPrice source) {
    RoomPriceSimple result = new RoomPriceSimple();

                result.setDayKey(source.getDayKey());
                result.setPrice(source.getPrice());
                result.setId(source.getId());
                if(source.getRoom()!=null){
                    result.setRoom(source.getRoom().getId());
                }
                if(source.getRoom()!=null){
                    result.setRoomName(source.getRoom().getName());
                }


    return result;
}

}